﻿using System.Collections.Generic;
using System.Linq;

namespace Inovout.Gis
{
    public abstract class PolygonLayeObject<T> : PolygonLayerObject
    {
        #region Constructor

        protected PolygonLayeObject(IGisTable gisTable)
            : base(gisTable)
        {
        }

        protected PolygonLayeObject(IGeometryLayerInfo geometryLayerInfo)
            : base(geometryLayerInfo)
        {
        }

        #endregion

        public new PolygonObject<T>[] Geometries
        {
            get
            {
                return base.Geometries.Cast<PolygonObject<T>>().ToArray();
            }
        }

        public new IEnumerable<T> Domains
        {
            get 
            {
                List<T> domains = new List<T>();
                foreach (var polygonElement in Geometries)
                {
                    domains.Add(polygonElement.Domain);
                }
                return domains;
            }
        }
    }
}
